<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');
		echo $this->Html->css('style');
		echo $this->Html->script('jquery-1.6.1.min');
		echo $scripts_for_layout;
	?>
</head>
<body>
	<div id="container">
		<div id="header">
			<h1><?php echo $this->Html->link(__('Home', true), '/'); ?></h1>
		</div>
		<div id="content">
			<div id="user-nav">
			<?php
				if ($isAuthorized) {
					$loginUser = $this->Session->read('Auth');
					echo __('Welcome', true).' '.$this->Html->link($loginUser['User']['last_name'], array('controller' => 'users', 'action' => 'account')).'. ';
					echo $this->Html->link(__('Logout', true), array('controller' => 'users', 'action' => 'logout')); 
				} else {
					if (Configure::read('User.useRegister')) {
						echo $this->Html->link(__('Register', true), array('controller' => 'users', 'action' => 'register'));
						echo ' or ';
					}
					echo $this->Html->link(__('Login', true), array('controller' => 'users', 'action' => 'login'));
				}
			?>
			</div>
			<?php echo $this->Session->flash(); ?>
			<?php echo $this->Session->flash('auth'); ?>
			<?php echo $content_for_layout; ?>
		</div>
		<div id="footer">
			<div id="language-bar">
				<?php
					$languages = Configure::read('System.languages');
					if (is_array($languages) AND count($languages) > 0) {
						echo __('Change language:', true).' ';
						foreach ($languages as $key=>$value) {
							echo $this->Html->link($this->Html->image('flags/'.$value.'.png', array("alt" => $value)), '/language/'.$key, array('escape' => false)).' ';
						}
					}
				?>
			</div>
		</div>
	</div>
	<?php echo $this->element('sql_dump'); ?>
	<?php echo $this->element('email_dump'); ?>
</body>
</html>